<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const obj={
            age:18,
            name:"hello world",
            height:181
        }
        //进行序列化
        let str=JSON.stringify(obj)
        console.log(str,typeof(str))
        //进行反序列化
        let obj_string='{"age":18,"name":"hello world","height":181}'
        let obj3=JSON.parse(obj_string)
        console.log(obj3)
    </script>
</body>
</html>

